﻿using System;

namespace Iveonik.ConsoleWrapper
{
    /// <summary>
    /// Exception with exit code for application.
    /// </summary>
    public class ExitCodeException: Exception
    {
        /// <summary>
        /// Code of application's finishing.
        /// </summary>
        public int ExitCode { get; private set; }

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="exitCode">Code of application's finishing.</param>
        /// <param name="message">Error message.</param>
        /// <param name="innerException">Catched subexception.</param>
        public ExitCodeException(int exitCode, string message = "", Exception innerException = null):
            base(message, innerException)
        {
            ExitCode = exitCode;
        }
    }
}
